/**
 * Copyright (C), 2018, 中电福富信息科技有限公司
 * FileName: YesNoEnum
 * Author:   linxiao
 * Date:     2018/7/30 15:35
 */
package com.example.demo.enums;

import com.ffcs.oss.common.utils.LocalMessageUtil;
import com.example.demo.web.rest.constant.ExportConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author weih
 * @target
 * @date 2019/12/21 15:35
 */
@ApiModel("各导入功能定义枚举类")
public enum ImportEnum {
    ROLE(LocalMessageUtil.getMessage(ExportConstant.EXPORT_ROLE_MANAGE), 0,
            new String[]{"角色名称","用户归属","用户名","姓名"},
            new String[]{"roleName","regionType","loginName","alias"}),
    USER(LocalMessageUtil.getMessage(ExportConstant.EXPORT_USER_MANAGE), 1,
            new String[]{"用户名","姓名","电话号码","邮箱","用户单位","用户归属","用户类型",
                    "描述信息","身份证号码","初始密码","角色"},
            new String[]{"loginName","alias","telephone","eMail","arg1","regionType",
                    "userType","description","pid","password","role"}),
    ROLE_NOT_NULL("角色表不为空字段",2,
            new String[]{"角色名称","用户名"},
            new String[]{"roleName","loginName"}),
    USER_NOT_NULL("用户表不为空字段",3,
            new String[]{"用户名","姓名","电话号码","邮箱","用户归属"},
            new String[]{"loginName","alias","telephone","eMail","regionType"})
    ;


    @ApiModelProperty(name = "导入文件名")
    private String remark;
    @ApiModelProperty(name = "对应导出模块类型，自定义，不能重复")
    private Integer value;
    @ApiModelProperty(name = "字段中文名", notes = "同导入列名相同")
    private String[] expColCn;
    @ApiModelProperty(name = "字段英文名", notes = "同导入实体中对应的属性相同")
    private String[] expColEn;

    ImportEnum(String remark, Integer value, String[]  expColCn, String[] expColEn) {
        this.remark = remark;
        this.value = value;
        this.expColCn = expColCn;
        this.expColEn = expColEn;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String[] getExpColCn() {
        return expColCn;
    }

    public void setExpColCn(String[] expColCn) {
        this.expColCn = expColCn;
    }

    public String[] getExpColEn() {
        return expColEn;
    }

    public void setExpColEn(String[] expColEn) {
        this.expColEn = expColEn;
    }

    public static ImportEnum valueOf(Integer value) {
        for (ImportEnum u : ImportEnum.values()) {
            if (u.getValue().equals(value)) {
                return u;
            }
        }
        return null;
    }

}
